class_name PlayerState

extends Node
signal state_transition_request(new_state: Player.State,state_data: PlayerStateData)

var ai_behavior : AIBehavior = null
var animation_player :AnimationPlayer = null
var ball: Ball = null
var ball_detection_area :Area2D = null
var state_data : PlayerStateData
var teammate_detection :Area2D = null
var player: Player = null
var own_goal : Goal = null
var target_goal : Goal = null 
var tackle_damage_emitter_area : Area2D  = null


func setup(context_player: Player,context_state_data : PlayerStateData\
,context_animation_player : AnimationPlayer,context_ball:Ball\
,context_teammate_detection : Area2D,context_ball_detection :Area2D\
,context_own_goal : Goal, context_target_goal : Goal, context_tackle_damage_area : Area2D,context_ai : AIBehavior) -> void:
	player = context_player
	state_data = context_state_data
	teammate_detection = context_teammate_detection
	ball_detection_area = context_ball_detection
	animation_player = context_animation_player
	ball = context_ball
	own_goal = context_own_goal
	target_goal = context_target_goal
	tackle_damage_emitter_area = context_tackle_damage_area
	ai_behavior = context_ai
	

func transaction_state(new_state: Player.State,data : PlayerStateData = PlayerStateData.new()) -> void:
	state_transition_request.emit(new_state,data)

func on_animation_complete() -> void:
	pass
	
func can_carry_ball() -> bool :
	return false

func can_pass() -> bool:
	return false
	
func is_ready_for_kickoff() -> bool:
	return false
